<template>
	<div class="lowerLevel-member">
		<HeaderTop :title="`会员详情`"></HeaderTop>
		<div class="lowerLevel-member-content">
			<div class="lowerLevel-member-content-list">
				<div class="left">登录名</div>
				<div class="right">{{loginName}}</div>
			</div>
			 <div class="lowerLevel-member-content-list">
				<div class="left">昵称</div>
				<div class="right">{{agentMark}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">级别</div>
				<div class="right">{{level}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">上级代理名</div>
				<div class="right">{{agentName}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">余额</div>
				<div class="right">{{money}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">首存金额 </div>
				<div class="right">{{firstMoney}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">状态</div>
				<div class="right">{{status}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">注册时间</div>
				<div class="right">{{createTime}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">首存时间</div>
				<div class="right">{{firstTime}}</div>
			</div>
			<div class="lowerLevel-member-content-list">
				<div class="left">最后登录</div>
				<div class="right">{{loginTime}}</div>
			</div>
		</div>
	</div>
</template>

<script>
import HeaderTop from '../../components/top/top';
export default {
	name: 'lowerLevel-member',
	components: {
		HeaderTop
	},
	data() {
		return {
      agentMark:'',
			loginName:'',
			realName:'',
			level:'',
			agentName:'',
			money:'',
			firstMoney:'',
			status:'',
			createTime:'',
			firstTime:'',
			loginTime:'',
			memberId:'',
		}
	},
	beforeRouteLeave (to, from, next) {    // 销毁组件，避免通过vue-router再次进入时，仍是上次的history缓存的状态
		sessionStorage.removeItem('memberId')
		this.$destroy(true)
		next()
	},
	mounted() {
		this.memberId = sessionStorage.getItem('memberId')
		this.getMemberDetail()
	},
	methods: {
		getMemberDetail(){
			let params = {
				memberId:this.memberId
			}
			this.ServerAPI.postAPI(this.API.getFindMember,params,(success,data)=>{
				if (success){
					if(data.code === '0000'){
						this.loginName = data.data.loginName
						this.realName = data.data.realName
						this.agentMark = data.data.agentMark
						this.level = data.data.level
						this.agentName = data.data.agentName
						this.money = data.data.money
						this.firstMoney = data.data.firstMoney
						this.createTime = data.data.createTime
						this.firstTime = data.data.firstTime
						this.loginTime = data.data.loginTime
						if(data.data.status === true){
							this.status = '正常'
						}else if(data.data.status === false){
							this.status = '禁用'
						}
					}
				}
			})
		},
	}
}
</script>

<style lang="scss" scoped>
.lowerLevel-member {
	.lowerLevel-member-content {
		padding: 0 .2rem;
		.lowerLevel-member-content-list {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 .1rem;
			height: 1rem;
			border-bottom: rgb(238,238,238) 1px solid;
			.left {
				color: rgb(46,46,46);
			}
			.right {
				color: rgb(107,107,107);
			}
		}
	}
}

</style>
